using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Web.Mvc;

namespace Catalyst.Mvc
{
	public abstract class LiteController<TModel> : Controller
		where TModel : LiteModel<TModel>, new()
    {
		public TModel Model { get; private set; }
		public SortedDictionary<int, string> SubMenuLinks { get; private set; }

		public LiteController()
		{
			Model = new TModel();
		}

		protected void AddSubMenuLink(int index, string action)
		{
			if (ViewData["submenu_links"] == null)
			{
				SubMenuLinks = new SortedDictionary<int, string>();
			}
			else
			{
				SubMenuLinks = (SortedDictionary<int, string>)ViewData["submenu_links"];
			}

			SubMenuLinks.Add(index, action);

			ViewData["submenu_links"] = SubMenuLinks;
		}
    }
}
